<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('admin_users', function (Blueprint $table) {
            $table->id();
            $table->string('username')->unique()->comment('账号');
            $table->string('password')->comment('密码');
            $table->string('mobile')->nullable()->unique()->comment('手机号码');
            $table->string('email')->nullable()->unique()->comment('邮箱');
            $table->dateTime('email_verified_at')->nullable()->comment('邮箱验证的时间');
            $table->dateTime('mobile_verified_at')->nullable()->comment('手机验证的时间');
            $table->date('birth_date')->nullable()->comment('出生年月日');
            $table->string('introduction')->default('')->comment('简介');
            $table->unsignedTinyInteger('sex')->default(0)->comment('性别 0 未填写，1 男，2 女');
            $table->unsignedTinyInteger('status')->default(0)->comment('用户状态 0 禁止， 1 启用');
            $table->unsignedTinyInteger('source')->comment('来源 1 主动注册');

            $table->datetimes();
            $table->softDeletesDatetime();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('admin_users');
    }
};
